package com.whfc.fim.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * 视频监控检测类型
 */
public enum FimDeviceRuleType {

    NOHELMET(10, "智能监控未佩戴安全帽报警", "人员未佩戴安全帽", "未戴"),

    NOREFLECTVEST(20, "智能监控未穿反光衣报警", "人员未穿反光衣", "未穿"),

    PERSONBEYOND(30, "智能监控人员越界报警", "人员越界", "越界"),

    PERSONFOCUS(40, "智能监控人员聚集报警", "人员聚集", "聚集"),

    PERSONFALL(50, "智能监控人员摔倒报警", "人员摔倒", "摔倒"),

    PERSONOUT(60, "智能监控人员离岗报警", "人员离岗", "离岗"),

    PERSONABOUT(70, "智能监控人员徘徊报警", "人员徘徊", "徘徊"),

    SOILOVER(80, "智能监控裸土未覆盖报警", "裸土未覆盖", "裸土"),

    FIRE(90, "智能监控火焰出现报警", "火焰出现", "火焰"),

    VEHICLEDETECT(100, "智能监控车辆出现报警", "车辆出现", "车辆"),

    TIRED_DRIVING(110, "智能监控车辆冲洗报警", "车辆冲洗", "冲洗"),

    SMOKING(120, "智能监控抽烟报警", "抽烟", "抽烟"),

    PLAYING_PHONE(130, "智能监控打电话报警", "打电话监测", "打电话"),

    SMOG(140, "智能监控烟雾报警", "烟雾报警", "烟雾"),

    AREA_INVADE(150, "智能监控区域入侵报警", "区域入侵", "区域入侵"),
    // electrocar
    ELECTROCAR(160, "智能监控电动车禁止报警", "电动车禁止", "电动车禁止"),
    // Stopped Vehicle
    STOPPED_VEHICLE(170, "智能监控车辆违停报警", "车辆违停", "车辆违停"),

    SLEEP_POST(180, "智能监控睡岗检测报警", "睡岗检测", "睡岗"),
    // escape way jam
    ESCAPE_WAY_JAM(190, "智能监控逃生通道堵塞报警", "逃生通道堵塞", "逃生通道堵塞"),

    ITEM_LOSE(200, "智能监控物品遗失报警", "物品遗失", "物品遗失"),

    MASK(210, "智能监控口罩监测报警", "口罩监测", "口罩"),

    AREA_PEOPLE_NUM(220, "智能监控区域人数统计报警", "区域人数统计", "区域人数统计"),

    BANXIAN_PEOPLE_NUM(230, "智能监控区域拌线人数统计报警", "拌线人数统计", "拌线人数统计"),

    CLIMB(240, "智能监控区域攀高监测报警", "攀高监测", "攀高"),

    PEOPLE_STAY(250, "智能监控区域人员逗留报警", "人员逗留", "人员逗留"),

    PEOPLE_GATHER(260, "智能监控区域人员聚集报警", "人员聚集", "人员聚集"),

    ACUTE_MOTION(270, "智能监控区域剧烈运动报警", "剧烈运动", "剧烈运动"),
    // uniform
    UNIFORM(280, "智能监控人员未穿工服报警", "未穿工服", "未穿工服"),


    ;

    private Integer value;

    private String tittle;

    private String detail;

    private String pic;

    FimDeviceRuleType(Integer value, String tittle, String detail, String pic) {
        this.value = value;
        this.tittle = tittle;
        this.detail = detail;
        this.pic = pic;
    }

    public Integer value() {
        return value;
    }

    public String tittle() {
        return tittle;
    }

    public String detail() {
        return detail;
    }

    public String pic() {
        return pic;
    }

    public static FimDeviceRuleType parseByValue(Integer value) {
        FimDeviceRuleType deviceRuleType = null;
        switch (value) {
            case 10:
                deviceRuleType = NOHELMET;
                break;
            case 20:
                deviceRuleType = NOREFLECTVEST;
                break;
            case 30:
                deviceRuleType = PERSONBEYOND;
                break;
            case 40:
                deviceRuleType = PERSONFOCUS;
                break;
            case 50:
                deviceRuleType = PERSONFALL;
                break;
            case 60:
                deviceRuleType = PERSONOUT;
                break;
            case 70:
                deviceRuleType = PERSONABOUT;
                break;
            case 80:
                deviceRuleType = SOILOVER;
                break;
            case 90:
                deviceRuleType = FIRE;
                break;
            case 100:
                deviceRuleType = VEHICLEDETECT;
                break;
            case 110:
                deviceRuleType = TIRED_DRIVING;
                break;
            case 120:
                deviceRuleType = SMOKING;
                break;
            case 130:
                deviceRuleType = PLAYING_PHONE;
                break;
            default:
                deviceRuleType = NOHELMET;
                break;
        }
        return deviceRuleType;
    }

    public static FimDeviceRuleType parseByTittle(String tittle) {
        FimDeviceRuleType deviceRuleType = null;
        switch (tittle) {
            case "智能监控未穿反光衣报警":
                deviceRuleType = NOREFLECTVEST;
                break;
            case "智能监控人员越界报警":
                deviceRuleType = PERSONBEYOND;
                break;
            case "智能监控人员聚集报警":
                deviceRuleType = PERSONFOCUS;
                break;
            case "智能监控人员摔倒报警":
                deviceRuleType = PERSONFALL;
                break;
            case "智能监控人员离岗报警":
                deviceRuleType = PERSONOUT;
                break;
            case "智能监控人员徘徊报警":
                deviceRuleType = PERSONABOUT;
                break;
            case "智能监控裸土未覆盖报警":
                deviceRuleType = SOILOVER;
                break;
            case "智能监控火焰出现报警":
                deviceRuleType = FIRE;
                break;
            case "智能监控车辆出现报警":
                deviceRuleType = VEHICLEDETECT;
                break;
            default:
                deviceRuleType = NOHELMET;
                break;
        }
        return deviceRuleType;
    }

    /**
     * 获取旋挖设备违规类型id
     *
     * @return
     */
    public static List<Integer> getRotaryViolationList() {
        List<Integer> checkTypeList = new ArrayList<>();
        checkTypeList.add(SMOKING.value());
        checkTypeList.add(PLAYING_PHONE.value());
        checkTypeList.add(TIRED_DRIVING.value());
        return checkTypeList;
    }
}
